package com.funny.learning.english.util;

import java.util.regex.Pattern;

public class LoginUtil {
		
	public static final Pattern EMAIL_ADDRESS_PATTERN = Pattern
			.compile("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" + "\\@"
					+ "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" + "(" + "\\."
					+ "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" + ")+");

	public static boolean checkEmail(String email) {
		return EMAIL_ADDRESS_PATTERN.matcher(email).matches();
	}

	public static final Pattern PHONE_NUMBER = Pattern
			.compile("^[0-9]{1}[0-9]{9}||^[0-9]{1}[0-9]{10}");

	public static boolean checkPhone(String phone) {
		return PHONE_NUMBER.matcher(phone).matches();
	}
	
}
